package com.yuanfeng.activity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuanfeng.activity.dto.CommonIsXianUpdateDTO;
import com.yuanfeng.activity.entity.ActivityReductionPolicyBaseEntity;
import com.yuanfeng.activity.vo.ReductionPolicyListVO;
import com.yuanfeng.commoms.dto.goods.ListPageQueryParamDTO;
import com.yuanfeng.commoms.dto.goods.ManjianzengzheGoodsRuleQueryDTO;
import com.yuanfeng.commoms.vo.activity.ManjianzengzheGoodsQueryResultVO;
import com.yuanfeng.commoms.vo.activity.ManjianzengzhePromotionContentQueryResultVO;
import com.yuanfeng.commoms.vo.activity.ModularGoodsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName ActivityReductionPolicyBaseMapper
 * @Description 满减赠折基本信息表
 * @Author cyp
 * @Date 2023-05-25 14:41:45
 * @Version 1.0
 **/
@Mapper
public interface ActivityReductionPolicyBaseMapper extends BaseMapper<ActivityReductionPolicyBaseEntity> {

    /**
     * 查询满减增折活动信息
     *
     * @param commonId
     * @return
     */
    ManjianzengzheGoodsQueryResultVO selectByGoodsId(@Param("commonId") Integer commonId);

    /**
     * 查询满减增折活动规则
     *
     * @param promotionId
     * @return
     */
    List<ManjianzengzheGoodsRuleQueryDTO> selectList(@Param("promotionId") Integer promotionId);

    /**
     * 查询满减增折
     * @param commonId
     * @return
     */
    List<ManjianzengzhePromotionContentQueryResultVO> selectContent(Integer commonId);

    /**
     * 查询所有 满减增折商品
     * @param page
     * @param param
     * @return
     */
    IPage<Map<String, Object>> webQueryActivityMapper(IPage<Map<String, Object>> page, ListPageQueryParamDTO param);

    /**
     * 查询活动商品价格
     */
    ModularGoodsVO selectPrice(@Param("goodsId") Integer goodsId);

    /**
     * 修改活动状态
     * @param param
     */
    void invalidManjianzengzheBase(@Param("param") Map<String, Object> param);

    /**
     * 修改商品活动状态
     * @param param
     */
    void updateCommonIsXian3(@Param("param") CommonIsXianUpdateDTO param);


    /**
     * 分页查询满减增折活动信息
     * @param page
     * @param param
     * @return
     */
    IPage<ReductionPolicyListVO> selectManjianzengzheBaseList(IPage<ReductionPolicyListVO> page , @Param("param") Map<String, Object> param);
}

